<form nz-form [formGroup]="group" (ngSubmit)="submit()">
    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="id">ID</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="IDErrorTpl">
            <input nz-input formControlName="id" />
            <ng-template #IDErrorTpl let-control>
                <ng-container *ngIf="control.hasError('required')">请输入ID!</ng-container>
            </ng-template>
        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="name" nzRequired>名称</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="nameErrorTpl">
            <input nz-input formControlName="name" />
            <ng-template #nameErrorTpl let-control>
                <ng-container *ngIf="control.hasError('required')">请输入名称!</ng-container>
            </ng-template>
        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="username">用户名</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <input nz-input formControlName="username" />

        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="password">密码</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <input nz-input type="password" formControlName="password" />

        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="external">外部</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <label nz-checkbox formControlName="external">外部</label>
        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="version">版本</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="verErrorTpl">
            <input nz-input formControlName="version" />
            <ng-template #verErrorTpl let-control>
                <ng-container *ngIf="control.hasError('required')">请输入版本!</ng-container>
            </ng-template>
        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="command">命令</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="comErrorTpl">
            <input nz-input formControlName="command" />
            <ng-template #comErrorTpl let-control>
                <ng-container *ngIf="control.hasError('required')">请输入命令!</ng-container>
            </ng-template>
        </nz-form-control>
    </nz-form-item>


    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="disabled">是否禁用</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <nz-switch nzCheckedChildren="是" nzUnCheckedChildren="否" name="disabled" formControlName="disabled">
            </nz-switch>
        </nz-form-control>
    </nz-form-item>
</form>